Skip to content

fix: handle uaa rate limit response when status is disabled #1414 - #1415

Open
Lokowandtg wants to merge 1 commit into
cloudfoundry:mainfrom
Lokowandtg:UaaRatelimitParseError
Open

Lokowandtg wants to merge 1 commit into
cloudfoundry:mainfrom
Lokowandtg:UaaRatelimitParseError

Conversation

@Lokowandtg

Copy link
Copy Markdown
Contributor

The optional fields are now marked as "nullable".

@Lokowandtg
Lokowandtg requested a review from ZPascal November 23, 2026 23:33

@ZPascal ZPascal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ZPascal ZPascal left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @Lokowandtg, the @Nullable change looks right nd good to me and matches what UAA sends when rate limiting is disabled.

The red integration test isn't caused by this PR. It's the FeatureFlagsV3Test cleanup blocking a Netty thread for 5 minutes, which then breaks the app push in AdminTest. That's fixed in 5.x.x, and I opened #1416 to bring it to main. Once that's merged, could you rebase on main so CI runs again?

Two things outside and optimization potential:

  1. A unit test for the parsing. There's no ReactorRatelimitTest yet. Something along the lines of the other AbstractUaaApiTest tests with two fixtures would be enough, one for the DISABLED response from #1414 ({"current":{"status":"DISABLED","asOf":"..."}}) and one for ACTIVE with all fields set.

  2. UaaRatelimitTest can't fail at the moment. onErrorResume turns every error into false, and materialize() + expectNextCount(1) also passes on an error signal. That's why it didn't catch #1414 in the first place. Can you drop both and assert on the actual status? While you're there, getCurrentData() can be null, so it would be good to check that before calling getStatus().

* The number of configured limiter mappings
*/
@JsonProperty("limiterMappings")
@Nullable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you mention in the Javadoc that this can be null now? Same for credentialIdExtractor and loggingLevel. UAA also leaves out limiterMappings when it's ACTIVE with 0 mappings, so someone doing int n = current.getLimiterMappings() will get an NPE.

*/
@JsonProperty("loggingLevel")
@Nullable
abstract String getLoggingLevel();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed for this PR, but maybe worth a follow-up: UAA also sends an "error" field in current when loading the rate limit config failed. We don't map it right now, so callers can't see why rate limiting is off. Happy to open an issue for that if you don't want to add it here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants